from django.conf.urls import url
from . import views

urlpatterns = [
    url(r'^register/$', views.RegisterView.as_view(), name='register'),
    url(r'^usernames/(?P<username>[0-9A-Za-z-_]{5,20})/$', views.UsernameCountView.as_view(), name='usernamecount'),
    url(r'^mobiles/(?P<mobile>1[3456789]\d{9}/$)', views.MobileCountView.as_view(), name='mobilecount'),
    url(r'^login/$', views.LoginView.as_view(), name='login'),
    url(r'^logout/$', views.LogoutView.as_view(), name='logout'),
    url(r'^userinfo/$', views.UserInfoView.as_view(), name='userinfo'),
    url(r'^emails/$', views.EmailView.as_view(), name='emails'),
    url(r'^emails/verification/$', views.VerifyEmailView.as_view(), name='emailsverify'),
    url(r'^addresses/$', views.AddressView.as_view(), name='addresses'),
    url(r'^addresses/create/$', views.CreateAddressView.as_view(), name='createaddress'),
    url(r'^addresses/(?P<address_id>\d+)/$', views.UpdateDestroyAddressView.as_view(), name='updateadd'),
    url(r'^addresses/(?P<address_id>\d+)/$', views.DefaultAddressView.as_view(), name='defaultadd'),
    url(r'^addresses/(?P<address_id>\d+)/$', views.DefaultAddressView.as_view(), name='defaultadd'),
    url(r'^password/$', views.ChangePasswordView.as_view(), name='changepwd'),

]